public class RS232
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
释放模块
Release the module |
static RS232 |
getInstance()
获取RS232操作实例
Get instance for OTG. |
boolean |
open(int baudrate) |
boolean |
open(int baudrate,
int databits,
int stopbits,
int check) |
byte[] |
receive()
接收数据,读取串口数据无等待时间
Receive data |
boolean |
send(byte[] data)
发送数据
Send data. |
int |
sendAndReceive(byte[] sendData,
byte[] outData) |
public static RS232 getInstance()
public boolean open(int baudrate)
public boolean open(int baudrate,
int databits,
int stopbits,
int check)
public boolean close()
public boolean send(byte[] data)
data - 数据 public byte[] receive()
public int sendAndReceive(byte[] sendData,
byte[] outData)